﻿using DotNetCore.CAP;
using Solution.Application.Dtos;
using System;
using System.Threading.Tasks;

namespace Solution.Application.Events.AppCreateOrderQueue
{
    public class EventHander : ICapSubscribe
    {
        public EventHander()
        {
        }

        [CapSubscribe("cap.create.order.queue", isPartial: false, Group = "cap.create.order.queue")]
        public async Task Handler(EventInput<Event> input)
        {
            Console.WriteLine($"Product {input.Data.ProductName} has been sold to the user {input.Data.UserId}");
            await Task.CompletedTask;
        }
    }
}